package com.epimarket.system;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.epimarket.model.EMF;
import com.epimarket.model.Personne;

public class Startup implements ServletContextListener
{

	@Override
	public void contextDestroyed(ServletContextEvent event)
	{
	}

	@Override
	public void contextInitialized(ServletContextEvent event)
	{
		Personne admin = Personne.findByUsername("admin");
		if (admin == null)
		{
			admin = new Personne();
			admin.setUsername("admin");
			admin.setPassword("123456");
			EMF.persist(admin);
		}
	}
	
}
